var through = require('through2');
const babel = require('@babel/core');
function gulpBabel(options) {
    function transform(file, enc, next) {
        const { code } = babel.transformSync(file.contents, options);
        file.contents = Buffer.from(code);
        this.push(file);
        next();
    }
    var stream = through.obj(transform);
    return stream;
};
module.exports = gulpBabel;